package com.sky.entity;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;

import java.io.Serializable;
import java.util.Date;

/**
 * 书评
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Document(collection = "review")  // 指定MongoDB集合名称
public class Review implements Serializable {
    private static final long serialVersionUID = 1L;
    /**
     * 书评发布状态 0待审核 1通过 2拒绝
     */
    public static final Integer PENDING=0;
    public static final Integer APPROVED=1;
    public static final Integer REJECTED=2;
    @Id
    private String id;  // MongoDB自动生成的_id
    @Field("u_id")
    private Integer uId; //用户id
    @Field("b_id")
    private String bId; //书籍id
    private String content;//内容
    private Integer rating;//评分
    @Field("status")
    private Integer status;
    @Field("createTime")
    private Date createTime;//发布时间
    @Field("updateTime")
    private Date updateTime;//修改时间


}
